import request from '@/utils/request'

/**
 * 分页获取
 */
export function getSuggestionByPage(params, pageNum, pageSize, token) {
    return request({
        url: '/suggestion/list/page',
        method: 'get',
        params: {
            ...params,
            pageNum,
            pageSize,
        },
        headers: {
            'token': token
        }
    })
}

/**
 * 保存
 */
export function addOrUpdateSuggestion(data, token) {
    return request({
        url: '/suggestion/addOrUpdate',
        method: 'post',
        params: {
            ...data
        },
        headers: {
            'token': token
        }
    })
}

/**
 * 用户建议信息详情
 */
export function getSuggestionDetail(id, token) {
    return request({
        url: '/suggestion/getSuggestionDetail/' + id,
        method: 'get',
        headers: {
            'token': token
        }
    })
}

/**
 * 删除用户建议信息
 */
export function delSuggestionById(id, token) {
    return request({
        url: '/suggestion/delSuggestionById/' + id,
        method: 'post',
        headers: {
            'token': token
        }
    })
}